package com.zyj.guava.partition;

import com.google.common.collect.Lists;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Example {
    public static void main(String[] args) {
        //0~30 左闭右开
        List<Integer> full = IntStream.range(0, 33).boxed().collect(Collectors.toList());
        System.out.println(full);

        System.out.println();

        //会将集合切分成3个区间, 每个区间有10个数字
        List<List<Integer>> partitions = Lists.partition(full, 10);
        System.out.println(partitions);
    }
}
